<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>bui.checkVersion</title>
    <!-- <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css"> -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../assets/css/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="stylesheet" href="../assets/css/combo.css">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
    <!-- <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script> -->
    <script src="../assets/js/jquery-1.9.1.min.js"></script>
    <script src="../assets/js/index.js"></script>
    <script src="../assets/js/yui-min.js"></script>
    <script src="../assets/js/combo/oop-min.js"></script>
    <script src="../assets/js/combo/array-extras-min.js"></script>
    <script src="../assets/js/combo/autocomplete.js"></script>
    <script src="../assets/js/combo/history-base-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="sidemenu" class="sidebar-menu">菜单</div>
<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
            
                <h1><a href="../index.html"><img src="../assets/css/logo.png" title="" width="30px"></a>
                <a href="../index.html">BUI</a>
                
                </h1>
            
            <p class="off-left">其它版本:<select name="" id="" onchange="window.location.href=this.value"><option value="/demo/api/index.html" selected>1.5.x</option><option value="/demo/api-1.4.8/index.html">1.4.8</option></select></p>
            <p class="off-left" style="font-size:12px;margin-right: 15px;">API for BUI 1.5.3 </p>
            
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div id="sidebar" class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
    <div id="api-tabview" class="tabview">

        <ul class="tabs">
            <li><a href="#api-classes">Classes</a></li>
            <li><a href="#api-modules">Modules</a></li>
        </ul>

        <div id="api-tabview-filter">
            <input type="search" id="api-filter" placeholder="Type to filter APIs">
        </div>

        <div id="api-tabview-panel">
            <ul id="api-classes" class="apis classes">
            
                <li><a href="../classes/bui.accordion.html">bui.accordion</a></li>
            
                <li><a href="../classes/bui.actionsheet.html">bui.actionsheet</a></li>
            
                <li><a href="../classes/bui.ajax.html">bui.ajax</a></li>
            
                <li><a href="../classes/bui.alert.html">bui.alert</a></li>
            
                <li><a href="../classes/bui.animate.html">bui.animate</a></li>
            
                <li><a href="../classes/bui.array.html">bui.array</a></li>
            
                <li><a href="../classes/bui.back.html">bui.back</a></li>
            
                <li><a href="../classes/bui.btn.html">bui.btn</a></li>
            
                <li><a href="../classes/bui.checkVersion.html">bui.checkVersion</a></li>
            
                <li><a href="../classes/bui.config.html">bui.config</a></li>
            
                <li><a href="../classes/bui.confirm.html">bui.confirm</a></li>
            
                <li><a href="../classes/bui.dialog.html">bui.dialog</a></li>
            
                <li><a href="../classes/bui.download.html">bui.download</a></li>
            
                <li><a href="../classes/bui.dropdown.html">bui.dropdown</a></li>
            
                <li><a href="../classes/bui.emitter.html">bui.emitter</a></li>
            
                <li><a href="../classes/bui.file.html">bui.file</a></li>
            
                <li><a href="../classes/bui.fileselect.html">bui.fileselect</a></li>
            
                <li><a href="../classes/bui.getPageParams.html">bui.getPageParams</a></li>
            
                <li><a href="../classes/bui.guid.html">bui.guid</a></li>
            
                <li><a href="../classes/bui.hint.html">bui.hint</a></li>
            
                <li><a href="../classes/bui.init.html">bui.init</a></li>
            
                <li><a href="../classes/bui.input.html">bui.input</a></li>
            
                <li><a href="../classes/bui.levelselect.html">bui.levelselect</a></li>
            
                <li><a href="../classes/bui.list.html">bui.list</a></li>
            
                <li><a href="../classes/bui.listview.html">bui.listview</a></li>
            
                <li><a href="../classes/bui.load.html">bui.load</a></li>
            
                <li><a href="../classes/bui.loader.html">bui.loader</a></li>
            
                <li><a href="../classes/bui.loading.html">bui.loading</a></li>
            
                <li><a href="../classes/bui.mask.html">bui.mask</a></li>
            
                <li><a href="../classes/bui.number.html">bui.number</a></li>
            
                <li><a href="../classes/bui.pickerdate.html">bui.pickerdate</a></li>
            
                <li><a href="../classes/bui.platform.html">bui.platform</a></li>
            
                <li><a href="../classes/bui.prompt.html">bui.prompt</a></li>
            
                <li><a href="../classes/bui.pullrefresh.html">bui.pullrefresh</a></li>
            
                <li><a href="../classes/bui.rating.html">bui.rating</a></li>
            
                <li><a href="../classes/bui.ready.html">bui.ready</a></li>
            
                <li><a href="../classes/bui.refresh.html">bui.refresh</a></li>
            
                <li><a href="../classes/bui.router.html">bui.router</a></li>
            
                <li><a href="../classes/bui.run.html">bui.run</a></li>
            
                <li><a href="../classes/bui.scroll.html">bui.scroll</a></li>
            
                <li><a href="../classes/bui.searchbar.html">bui.searchbar</a></li>
            
                <li><a href="../classes/bui.select.html">bui.select</a></li>
            
                <li><a href="../classes/bui.sidebar.html">bui.sidebar</a></li>
            
                <li><a href="../classes/bui.slide.html">bui.slide</a></li>
            
                <li><a href="../classes/bui.stepbar.html">bui.stepbar</a></li>
            
                <li><a href="../classes/bui.storage.html">bui.storage</a></li>
            
                <li><a href="../classes/bui.store.html">bui.store</a></li>
            
                <li><a href="../classes/bui.swipe.html">bui.swipe</a></li>
            
                <li><a href="../classes/bui.tab.html">bui.tab</a></li>
            
                <li><a href="../classes/bui.timer.html">bui.timer</a></li>
            
                <li><a href="../classes/bui.toggle.html">bui.toggle</a></li>
            
                <li><a href="../classes/bui.typeof.html">bui.typeof</a></li>
            
                <li><a href="../classes/bui.unit.html">bui.unit</a></li>
            
                <li><a href="../classes/bui.upload.html">bui.upload</a></li>
            
                <li><a href="../classes/bui.viewport.html">bui.viewport</a></li>
            
            </ul>

            <ul id="api-modules" class="apis modules">
            
                <li><a href="../modules/Animate.html">Animate</a></li>
            
                <li><a href="../modules/Core.html">Core</a></li>
            
                <li><a href="../modules/Event.html">Event</a></li>
            
                <li><a href="../modules/Method.html">Method</a></li>
            
                <li><a href="../modules/Native.html">Native</a></li>
            
                <li><a href="../modules/UI.html">UI</a></li>
            
            </ul>
        </div>
    </div>
</div>
 
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
        Show:
        <label for="api-show-inherited">
            <input type="checkbox" id="api-show-inherited" checked>
            Inherited
        </label>

        <label for="api-show-protected">
            <input type="checkbox" id="api-show-protected">
            Protected
        </label>

        <label for="api-show-private">
            <input type="checkbox" id="api-show-private">
            Private
        </label>
        <label for="api-show-deprecated">
            <input type="checkbox" id="api-show-deprecated">
            Deprecated
        </label>

    </div>


            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
                        <h1>bui.checkVersion Class</h1>
<div class="box meta">
    

    

    
        <div class="foundat">
            Defined in: <a href="../files/_Users_wilson_personal_htdocs_opensource_bui-rollup_src_scripts_method_bui.checkVersion.js.html#l7"><code>&#x2F;Users&#x2F;wilson&#x2F;personal&#x2F;htdocs&#x2F;opensource&#x2F;bui-rollup&#x2F;src&#x2F;scripts&#x2F;method&#x2F;bui.checkVersion.js:7</code></a>
        </div>
    

    
        
            Module: <a href="../modules/Method.html">Method</a>
        
    

    
</div>



<div class="box intro">
    <p><h3>检查版本更新</h3></p>
<p><p>需要把对应的<a href="http://www.easybui.com/demo/json/versionUpdate.json" target="_blank">versionUpdate.json</a> 放到服务器,然后通过修改里面的值来进行检测更新</p></p>
<p><p>默认是检测BUI的版本更新,需要替换成自己业务的更新,更新有3种情况</p></p>
<p><p>第1种,当前版本已经是最新的</p></p>
<p><p>第2种,forced=true的情况, 当前版本比新版旧, 但比最小版本要新, 这时候会有弹窗, 但不一定要更新, 每次打开会提醒一次. </p></p>
<p><p>第3种,forced=true的情况, 当前版本比新版旧, 并且比最小版本要小, 这样就必须更新才功能正常.</p></p>
<p><p>第4种,forced=false的情况, 当前版本跟新版一样, 则提醒用户已经最新版, 可以通过 needTips关闭,  当前版本比新版旧, 会提醒用户,一般使用红点无干扰提醒.</p></p>
<p><h5>versionUpdate.json 文件说明: </h5><br>
{<br>
           &quot;versionName&quot;: &quot;1.0&quot;,          //版本名称<br>
           &quot;versionCode&quot;: 20160605,       //版本ID<br>
           &quot;minVersionCode&quot;: 20160604,    //最小版本号<br>
           &quot;forced&quot;: true,              //是否强制更新,如果强制更新,需要检测最小版本号<br>
           &quot;downloadUrl&quot;: &quot;<a href="http://www.easybui.com/download/bui.apk">http://www.easybui.com/download/bui.apk</a>&quot;,             //下载的地址<br>
           &quot;iosDownloadUrl&quot;: &quot;<a href="https://itunes.apple.com/cn/app/id1362470378?mt=8">https://itunes.apple.com/cn/app/id1362470378?mt=8</a>&quot;,          //下载的地址<br>
           &quot;remark&quot;: &quot;版本更新的内容&quot;        //新版本的描述,支持html<br>
       }<br></p>

</div>


    <div class="constructor">
        <h2>Constructor</h2>
        <div id="method_bui.checkVersion" class="method item">
    <h3 class="name"><code>bui.checkVersion</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>option</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/_Users_wilson_personal_htdocs_opensource_bui-rollup_src_scripts_method_bui.checkVersion.js.html#l7"><code>&#x2F;Users&#x2F;wilson&#x2F;personal&#x2F;htdocs&#x2F;opensource&#x2F;bui-rollup&#x2F;src&#x2F;scripts&#x2F;method&#x2F;bui.checkVersion.js:7</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        
    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">option</code>
                        <span class="type">String</span>
                    

                    

                    <div class="param-description">
                         
                    </div>

                    
                        <ul class="params-list">
                            
                            <li class="param">
                                
                                    <code class="param-name">url</code>
                                    <span class="type">String</span>
                                

                                <div class="param-description">
                                    <p>[请求更新的地址]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name">currentVersion</code>
                                    <span class="type">String</span>
                                

                                <div class="param-description">
                                    <p>[当前版本名称,用来提醒的版本名称]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name">currentVersionCode</code>
                                    <span class="type">String</span>
                                

                                <div class="param-description">
                                    <p>[当前版本号,用来比对的唯一值]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[id]</code>
                                    <span class="type">String</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[检测更新的按钮,非必须]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[target]</code>
                                    <span class="type">String</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[按钮的圆点要放在哪个位置,默认在i标签下]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[title]</code>
                                    <span class="type">String</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[对话框提醒的标题]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[data]</code>
                                    <span class="type">Object</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[是否需要传参]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[method]</code>
                                    <span class="type">String</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[请求的方法 GET | POST ]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[timeout]</code>
                                    <span class="type">Number</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[超时 20000]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[needTips]</code>
                                    <span class="type">Boolean</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[是否需要提醒 1.5.0 ]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[field]</code>
                                    <span class="type">Object</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[是否需要提醒 1.5.3 ]</p>

                                </div>

                                
                                    <ul class="params-list">
                                        
                                        <li class="param">
                                            
                                                <code class="param-name optional">[data]</code>
                                                <span class="type">Object</span>
                                                <span class="flag optional" title="This parameter is optional.">optional</span>
                                            

                                            <div class="param-description">
                                                [ 返回的数据在哪个key ]
                                            </div>
                                        </li>
                                        
                                    </ul>
                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[tips]</code>
                                    <span class="type">Object</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    
                                </div>

                                
                                    <ul class="params-list">
                                        
                                        <li class="param">
                                            
                                                <code class="param-name optional">[nowVersion]</code>
                                                <span class="type">String</span>
                                                <span class="flag optional" title="This parameter is optional.">optional</span>
                                            

                                            <div class="param-description">
                                                [当前是最新版本的提醒,默认提醒会有版本号]
                                            </div>
                                        </li>
                                        
                                        <li class="param">
                                            
                                                <code class="param-name optional">[minVersion]</code>
                                                <span class="type">String</span>
                                                <span class="flag optional" title="This parameter is optional.">optional</span>
                                            

                                            <div class="param-description">
                                                [版本太低需要强制更新的提醒]
                                            </div>
                                        </li>
                                        
                                        <li class="param">
                                            
                                                <code class="param-name optional">[fail]</code>
                                                <span class="type">String</span>
                                                <span class="flag optional" title="This parameter is optional.">optional</span>
                                            

                                            <div class="param-description">
                                                [网络请求失败的提醒]
                                            </div>
                                        </li>
                                        
                                    </ul>
                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[callback]</code>
                                    <span class="type">Function</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[点击按钮以后是否还有其它业务处理]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[onSuccess]</code>
                                    <span class="type">Function</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[1.4.2 新增请求成功的处理]</p>

                                </div>

                                
                            </li>
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[onFail]</code>
                                    <span class="type">Function</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>[1.4.2 新增请求失败的处理]</p>

                                </div>

                                
                            </li>
                            
                        </ul>
                    
                </li>
            
            </ul>
        </div>
    

    

    
        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <pre class="code prettyprint"><code>bui.checkVersion({
    id: &quot;#checkUpdate&quot;,
          currentVersion: &quot;&quot;,
          currentVersionCode: &quot;&quot;,
    url: &quot;http://www.easybui.com/json/versionUpdate.json&quot;
});</code></pre>

            </div>
        </div>
    
</div>

    </div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

        
        
        
        
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

            

            

            

            
        </div>

        

        

        

        
    </div>
</div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
<!-- 百度统计 -->
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?50f5631d37bf0ccb2034e80da6eb2972";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>


</body>
</html>
